package cn.cs.client;

import cn.cs.config.CsConfiguration;
import cn.cs.fallback.ShoppingCarClientFallBack;
import cn.cs.pojo.CarProductList;
import cn.cs.pojo.ShoppingCart;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(name = "cs-shop-provider", configuration = CsConfiguration.class, fallback = ShoppingCarClientFallBack.class)
public interface ShoppingCarClient {
    @RequestMapping(value = "/getShopCartByMap", method = RequestMethod.POST)
    ShoppingCart getShopCartByMap(@RequestBody Map<String, Object> map);
    @RequestMapping(value = "/insertShoppingCart", method = RequestMethod.POST)
    int insertShoppingCart(@RequestBody ShoppingCart shopCar);
    @RequestMapping(value = "/deleteOtherShopCar", method = RequestMethod.POST)
    int deleteOtherShopCar(@RequestBody Map<String, Object> param);
    @RequestMapping(value = "/getProCountOfCar", method = RequestMethod.POST)
    Map<String,Object> getProCountOfCar(@RequestBody Map<String, Object> param);
    @RequestMapping(value = "/updateCarProductCount", method = RequestMethod.POST)
    int updateCarProductCount(@RequestBody Map<String, Object> param);
    @RequestMapping(value = "/insertCarProductList", method = RequestMethod.POST)
    int insertCarProductList(@RequestBody CarProductList pro);
    @RequestMapping(value = "/getProshops", method = RequestMethod.POST)
    List<Map<String,Object>> getProshops(@RequestBody Map<String, Object> para);
    @RequestMapping(value = "/getProsByMap", method = RequestMethod.POST)
    List<Map<String,Object>> getProsByMap(@RequestBody Map<String, Object> para);
    @RequestMapping(value = "/getCarProductListListByMap", method = RequestMethod.POST)
    List<CarProductList> getCarProductListListByMap(@RequestBody Map<String, Object> map);
    @RequestMapping(value = "/getShopsByProIds", method = RequestMethod.POST)
    List<Map<String,Object>> getShopsByProIds(@RequestBody Map<String, Object> param);
    @RequestMapping(value = "/deleteCarProductListById", method = RequestMethod.POST)
    int deleteCarProductListById(@RequestParam("id") String id);
    @RequestMapping(value = "/updateCarProductList", method = RequestMethod.POST)
    int updateCarProductList(@RequestBody CarProductList pro);
}
